import ResourceIndex from './resourceIndex'
import ResourceList from './resourceList'
const houseResRouter = {

  path: 'landlord/houseResource',
  getChildRoutes(location, cb) {
    require.ensure([], (require) => {
      cb(null, [
        {
          path: 'list',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./resourceList'))
            })
          },

        },
        {
          path: 'add',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./resourceAdd'))
            })
          }
        },
        {
          path: 'update',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./resourceModify'))
            })
          }
        },
        {
          path: 'pay',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./payFee'))
            })
          }
        },
        {
          path: 'history',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./costRecord'))
            })
          }
        },
        {
          path: 'contract',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./stopContract'))
            })
          }
        }
      ])
    })
  },

  indexRoute: {
    getComponents(location, cb) {
      require.ensure([], function (require) {
        cb(null, ResourceList)
      })
      return cb()
    }
  },

  getComponents(nextState, cb) {
    require.ensure([], (require) => {
      cb(null, require('./resourceIndex'))
    })
  }
}

export default houseResRouter;

